﻿namespace Sales
{
    class Section
    {
        public string Title { get; set; }
        public byte Id { get; set; }

        public override int GetHashCode()
        {
            return Id;
        }

        public override bool Equals(object obj)
        {
            return obj != null && GetHashCode() == obj.GetHashCode();
        }

        public override string ToString()
        {
            return Title;
        }

        static public bool operator ==(Section a, Section b)
        {
            if((object)a == null) return ((object) b == null);
            return a.Equals(b);
        }

        static public bool operator !=(Section a, Section b)
        {
            if ((object)a == null) return (object)b != null;
            return !a.Equals(b);
        }
    }
}
